package top.hidoctor.auscultation.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import top.hidoctor.auscultation.R;
import top.hidoctor.auscultation.bean.LabelListBean;

public class BiaozhuListAdapter extends BaseQuickAdapter<LabelListBean.ResultBean> {

    public BiaozhuListAdapter(int layoutResId, List<LabelListBean.ResultBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, LabelListBean.ResultBean item) {
//        :10:标注开始；20：标注完成;30:标注包超时
        helper.setText(R.id.tv_status, item.getStatus() == 10 ? "标注开始" : item.getStatus() == 20 ? "标注完成" : item.getStatus() == 30 ? "标注包超时" : "")
                .setImageResource(R.id.iv_status, item.getStatus() == 10 ? R.mipmap.ic_shenhekaishi : item.getStatus() == 20 ? R.mipmap.ic_shenhewancheng : item.getStatus() == 30 ? R.mipmap.jxsb : null)
                .setTextColor(R.id.tv_status, item.getStatus() == 10 ? mContext.getResources().getColor(R.color.c_cccccc) : item.getStatus() == 20 ? mContext.getResources().getColor(R.color.blue_main) : item.getStatus() == 30 ? mContext.getResources().getColor(R.color.red_main) : null)
                .setText(R.id.tv_no, item.getName())
                .setText(R.id.tv_number, "样本数量：" + item.getSampleTotal());
    }
}
